package com.dingding.service.userorderservice.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.transaction.annotation.Transactional;

import com.dingding.bean.databean.response.DataResponse;
import com.dingding.bean.entity.Stageprice;
import com.dingding.service.BaseService;
import com.dingding.service.userorderservice.IStagePriceService;

/**
 * @ClassName: StagePriceServiceImpl
 * @Description: 计价规则实现
 * @author lijinchao
 * @date 2015-11-23 下午04:46:30
 * @version
 */
public class StagePriceServiceImpl extends BaseService implements
		IStagePriceService {

	private Logger log = Logger.getLogger(this.getClass());

	/**
	 * @Title: getOrderPriceRule
	 * @Description: 获取计价规则数据
	 * @author lijinchao
	 * @return List<Stageprice>
	 * @throws
	 */
	@Override
	@Transactional(readOnly = true)
	public List<Stageprice> getOrderPriceRule() {

		List<Stageprice> stageprices = null;
		Criterion criterion = Restrictions.eq("status", 1);

		try {
			stageprices = super.stagePriceDao.queryCriteriaListByOrderDesc(
					criterion, "stage", false);
		} catch (Exception e) {
			log.error("获取计价规则数据出现异常 类" + this.getClass()
					+ " 方法:getOrderPriceRule()", e);
			return null;
		}

		return stageprices;
	}

	@Override
	public void setStatus(DataResponse dataResponse, int status) {

	}
}
